package com.hmall.common.utils;

import org.springframework.stereotype.Component;

public class BaseThreadLocal {
    public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();
    public static void setUserId(Long id){
        threadLocal.set(id);
    }
    public static Long getUserId(){
        return threadLocal.get();
    }
    public static void removeUserId() {
        threadLocal.remove();
    }
}
